use ../../final_w1w2.dta, clear

log using "TableA4", text replace


encode country, gen(country_cat)

tab ethnocentrism
gen ethno_factor = . 
replace ethno_factor = 1 if ethnocentrism <=.375
replace ethno_factor = 2 if ethnocentrism >.375 & ethnocentrism < .625
replace ethno_factor = 3 if ethnocentrism >=.625 & ethnocentrism !=.

tab ethno_factor

gen nonwhite = . 
replace nonwhite = 1 if race != 1 & race != .
replace nonwhite = 0 if race == 1


*Model 1 

reg profile_chosen b4.country_cat i.mark_up_cat i.rating_cat, cluster(id)   
est store m1 

*Model 2 

reg profile_chosen b4.country_cat##i.ethno_factor i.mark_up_cat i.rating_cat, cluster(id)   
est store m2 

*Model 3 

reg profile_chosen b4.country_cat##i.ethno_factor i.mark_up_cat i.rating_cat i.pid3_lean age i.nonwhite i.college inc , cluster(id)   
est store m3


*Model 4 

reg profile_chosen b4.country_cat##i.ethno_factor i.mark_up_cat##i.ethno_factor i.rating_cat##i.ethno_factor i.pid3_lean age i.nonwhite i.college inc , cluster(id)   
est store m4


esttab m1 m2 m3 m4 using TableA4.csv, b(3) se(3) nobaselevels nogaps replace



log close





